package com.atguigu.gulimallcart.service;

import com.atguigu.gulimallcart.vo.Cart;
import com.atguigu.gulimallcart.vo.CartItem;
import com.baomidou.mybatisplus.core.metadata.OrderItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface ICartService {
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    Cart getCart() throws ExecutionException, InterruptedException;

    void clearCart(String cartKey);

    /**
     * 根据skuId获取购物车里购物项
     * @param skuId 商品skuId
     * @return CartItem 购物项
     */
    CartItem getCartItem(Long skuId);

    void checkItem(Long skuId, Integer check);

    void countItem(Long skuId, Integer count);

    void delItem(Long skuId);

    List<OrderItem> currentUserCartItems();
}
